/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package circuit1;

/**
 *
 * @author Erik
 */
import java.util.Observable;

public class Wire extends Observable {

    private boolean value;
    private String id;

    public Wire() {
        //System.out.printf("Wire.Wire()\n");
        value = false;
    }

    public void setValue(boolean v) {
        //System.out.printf("Wire.setValue()\n");
        if (value != v) {
            setChanged();
            notifyObservers();
            //System.out.println(getId() + " valtozott: " + v);
        } else {
            //System.out.println(getId() + " nem valtozott: " + v);
        }
        value = v;
    }

    public boolean getValue() {
        //System.out.printf("Wire.getValue()\n");
        return value;
    }

    public void setId(String _id) {
        id = _id;
    }

    public String getId() {
        return id;
    }
}
